import { createRouter, createWebHistory } from 'vue-router';
import Login from '@/view/login/index.vue'
import Layout from '@/view/layout/index.vue'
import Category from '@/view/category/index.vue'
import Home from '@/view/Home.vue'

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            component: Layout,
            children: [
              {
                path:'',
                component: Home
              },
              {
                path:'category',
                component: Category
              }
            ]
        },
        {
            path: '/login',
            component: Login
        }
    ]
})
export default router

// import { createRouter, createWebHistory } from 'vue-router';
// // 假设你有一个名为Home的组件，需要根据实际情况导入正确的组件路径
// import Home from './view/Home.vue'; 
// const router = createRouter({
//   history: createWebHistory(),
//   routes: [
//     {
//       path: '/',
//       name: 'Home',
//       component: Home
//     }

//     // 可以在这里添加更多的一级路由配置
//   ]
// });
// export default router;